/**
 * Created by python on 19-3-4.
 */
var vm = new Vue({
    el: '#app',
    data:{
        host:HOST,
        user_id: sessionStorage.user_id || localStorage.user_id,
        token: sessionStorage.token || localStorage.token,
        username: sessionStorage.username || localStorage.username,

        living: '',
        college: '',
        company:'',
        website:'',
        resume:'',
        nickname:'',
        profession:'',
        position:'',

    },
    mounted: function () {
        axios.get(this.host+'/users/homepage',{
         headers: {
                'Authorization': 'JWT ' + this.token
            },
            responseType:'json'
        })
        .then(response => {
            this.living = response.data.living;
            this.college = response.data.college;
            this.company = response.data.company;
            this.website = response.data.website;
            this.resume = response.data.resume;
            this.nickname = response.data.nickname;
            this.profession = response.data.profession;
            this.position = response.data.position;
            this.mobile = response.data.user.mobile;
            
        })
        .catch(error => {
            alert(error.response.data);
        });
    }


})